import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:car_baidu/core/constant/common_constant.dart';
import 'package:flutter/material.dart';

import '../../shared/px/double_extentsion.dart';
import '../../shared/px/int_extentsion.dart';

class LLHomePageContent extends StatefulWidget {
  const LLHomePageContent({Key? key}) : super(key: key);

  @override
  _LLHomePageContentState createState() => _LLHomePageContentState();
}

class _LLHomePageContentState extends State<LLHomePageContent> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Container(
        padding: EdgeInsets.symmetric(horizontal: 12.px),
        child: Stack(
          children: [
            ListView(
              children: [
                // 头部地图
                getHomePageHeaderWidget(context),
                // locationInfo
                getHomePageLocationInfoWidget(context),
                // 中部
                // 底部
              ],
            ),
          ],
        ),
      ),
    );
  }

  Widget getHomePageHeaderWidget(BuildContext context) {
    return Container(
      width: double.maxFinite,
      height: 201.5.px,
      child: Stack(
        children: [
          // 地图
          AMapWidget(
              apiKey: CommonConstant.amapApiKeys,
              myLocationStyleOptions: MyLocationStyleOptions(true)),
        ],
      ),
    );
  }

  Widget getHomePageLocationInfoWidget(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(top: 3.px),
      decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(5), color: Colors.white),
      height: 80.px,
      child: Column(),
    );
  }
}
